Carbon


KCAddCallback

Header: Keychain.h Carbon status: Under Evaluation

Registers your keychain event callback function.

OSStatus KCAddCallback (
    KCCallbackUPP callbackProc, 
    KCEventMask eventMask, 
    void *userContext
);
Parameter descriptions
callbackProc

A Universal Procedure Pointer (UPP) to your keychain event callback function, described in KCCallbackProcPtr. You indicate the type of keychain events you want to receive by passing a bitmask of the desired events in the eventMask parameter. To create a UPP to your callback function, call the function NewKCCallbackUPP.

eventMask

A bitmask indicating the keychain events that your application wishes to be notified of. See “Keychain Event Mask Constants” for a description of this bitmask. The Keychain Manager tests this mask to determine the keychain events that you wish to receive, and passes these events in the keychainEvent parameter of your callback function. See “Keychain Event Constants” for a description of these events.

userContext

A pointer to application-defined storage that will be passed to your callback function. Your application can use this to associate any particular call of KCAddCallback with any particular call of your keychain event callback function.

function result

A result code. The result code errKCDuplicateCallback indicates that your callback function is already registered.

DISCUSSION

You can register your callback function by passing a UPP to it in the callbackProc parameter of the KCAddCallback function. Once you done so, the Keychain Manager calls the function InvokeKCCallbackUPP when the keychain event specified in the eventMask parameter occurs. In turn, InvokeKCCallbackUPP passes the keychain event, information about the event, and application-defined storage to your keychain event callback function.

VERSION NOTES

Available beginning with Keychain 1.0.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)